package com.lion.ball.modules.orderfood.service.assistants.converters;

import java.sql.Timestamp;
import com.lion.common.base.utils.ConvertUtil;
import com.lion.common.base.utils.DbUtil;
import com.lion.common.spring.annotations.DataConverter;
import com.lion.common.spring.business.base.BaseConverter;
import com.lion.utils.TimeUtil;
import com.lion.ball.modules.orderfood.domain.entity.OfdCategoryFoodEntity;
import com.lion.ball.modules.orderfood.web.model.params.create.OfdCategoryFoodCreateParam;
import com.lion.ball.modules.orderfood.web.model.params.update.OfdCategoryFoodUpdateParam;
import com.lion.ball.modules.orderfood.web.model.results.OfdCategoryFoodResult;

/**
 * @author Chris Chan
 * Create on 2025-10-18 13:33
 * Use for: 类别食品关联 业务数据转换助手
 * Explain:
 * 
 */
@DataConverter
public class OfdCategoryFoodConverter implements BaseConverter<
        OfdCategoryFoodEntity,
        OfdCategoryFoodCreateParam,
        OfdCategoryFoodUpdateParam,
        OfdCategoryFoodResult> {
    @Override
    public OfdCategoryFoodEntity fromParam(OfdCategoryFoodCreateParam param) {
        OfdCategoryFoodEntity entity = new OfdCategoryFoodEntity();
        ConvertUtil.copyProperties(param, entity, "id");
        return entity;
    }

    @Override
    public OfdCategoryFoodEntity fromUpdateParam(OfdCategoryFoodUpdateParam param) {
        OfdCategoryFoodEntity entity = ConvertUtil.convert(param, OfdCategoryFoodEntity.class);
        return entity;
    }

    @Override
    public OfdCategoryFoodResult toResult(OfdCategoryFoodEntity entity) {
        OfdCategoryFoodResult result = ConvertUtil.convert(entity,OfdCategoryFoodResult.class);
        return result;
    }
}